package com.webchat.netty.server.service.redis;

public class StringRedisService extends AbstractRedisService {


    public static void set(String key, String value, long seconds) {

        executeAndRelease(jedis -> {
            jedis.set(key, value);
            if (seconds > 0) {
                jedis.expire(key, seconds);
            }
        });
    }

    public static String get(String key) {

        return executeAndReleaseWithReturn(jedis -> {
            return jedis.get(key);
        });
    }
}
